package com.kt.appinfo.servlet;

import com.kt.appinfo.dao.DevUserMapper;
import com.kt.appinfo.pojo.DevUser;
import lombok.extern.log4j.Log4j2;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
@Log4j2
public class devServletimpl implements devServlet {
    @Autowired
    private DevUserMapper devUserMapper;

    @Override
    public DevUser doLogin(String devCode, String devPassword) throws Exception {
        try {
            //1、先根据用户名查询用户信息
            DevUser devUser = devUserMapper.getLoginUser(devCode);
            if (null != devUser) {
                //2、将查询出来的用户密码与传递过来的密码进行比对
                if (devPassword.equals(devUser.getDevPassword())) {
                    return devUser;
                } else {
                    return null;
                }
            }
            return null;
        } catch (Exception e) {
            log.error(e.getMessage(), e);
            throw e;
        }
    }
    }



